<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"                
    xmlns:math="http://exslt.org/math"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    exclude-result-prefixes="msxml math">
  <msxml:script language="JavaScript" implements-prefix="math">
    function random(numDie, numMax ,numMin)
    {
    if (numMin==null)
    {
    numMin = 1;
    }
    var sum = 0;
    for (var index=0; index&lt;numDie; index++)
    {
    sum+=Math.floor(Math.random()*(numMax-numMin) + numMin);
    }
    return "" + sum;
    }
    function floorme(numFloor)
    {
    return "" + Math.floor(numFloor);
    }
  </msxml:script>
</xsl:stylesheet>